home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_tem_meetwarrior.cog < prev    next >
Text File  |  1999-11-15  |  4KB  |  165 lines

  1. # Jones 3D Cog Script
  2. #
  3. # TEM_MeetWarrior.cog
  4. #
  5. # [TRM]
  6. #
  7. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  8. # ========================================================================================
  9.  
  10. symbols
  11.  
  12.     message     startup
  13.     message     entered
  14.     
  15.     thing       player          local
  16.     thing       indy            local
  17.     
  18.     thing       warrior
  19.     thing       cam_Meet
  20.     thing       meet_Targ       # cam_Meet focus
  21.     
  22.     thing       lookTarg1
  23.     thing       walkTarg1
  24.     
  25.     thing       lw_lookTarg1
  26.     thing       lw_walkTarg1
  27.     
  28.     sector      trig_Meet
  29.     sector      lookAtMe
  30.     
  31.     keyframe    warrior_Roar=lw_roar.key                local
  32.     keyframe    indy_Startled=0in_startled_1_1.key      local
  33.     keyframe    indy_Stand=in_stand.key                 local
  34.     
  35.     template    tpl_Indy=indy_sh_actor          local
  36.     
  37.     sound       say_RocksMove=tm02j01.wav           local   # Haaa!  The rocks move...
  38.     sound       snd_Roar=tem_warrior_roar_c.wav     local   # like, roar.
  39.     
  40.     ai            awake=lavawarrior.ai            local
  41.     
  42.     vector      curVel          local
  43.     
  44.     flex        speedO          local
  45.     
  46.     int         curCam          local
  47.     int         done=0          local
  48.     int         voiceLine       local
  49.     
  50. end
  51.  
  52. # ========================================================================================
  53.  
  54. code
  55.  
  56. startup:
  57.  
  58.     player = GetLocalPlayerThing();
  59.     return;
  60.  
  61. # ========================================================================================
  62.  
  63. entered:
  64.     
  65.     curCam = GetCurrentCamera();
  66.     
  67.     if((GetSenderRef() == trig_Meet) && (done == 0))
  68.     {
  69.         done = 1;
  70.         
  71.         # get player speed and translate to flex
  72.         #curVel = GetThingVel(player);
  73.         #speedO = VectorLen(curVel);
  74.     
  75.         # do cutscene stuff
  76.         MakeMeStop();
  77.         StartCutscene(2);
  78.  
  79.         # switch to cam_Meet
  80.         SetCameraFocus(2, cam_Meet);
  81.         SetCameraSecondaryFocus(2, meet_Targ);
  82.         SetCurrentCamera(2);
  83.         SetCameraFOV(90, 0, 0.0);
  84.         
  85.         # create indy actor
  86.         indy = CreateThing(tpl_Indy, player);
  87.         CaptureThing(indy);
  88.         
  89.         # outfit indy actor
  90.         DeselectWeaponWait(player);
  91.         CopyPlayerHolsters(player, indy);
  92.         
  93.         # hide player show indy
  94.         SetThingFlags(player, 0x80000);
  95.         ClearThingFlags(indy, 0x80000);
  96.         
  97.         # wake up lava warrior
  98.         #AISetMode(warrior, 0x4);    # MODE = SEARCHING
  99.         AISetMode(warrior, 0x2);    # MODE = ATTACKING
  100.         
  101.         # walk indy closer to warrior
  102.         AISetMoveSpeed(indy, 1.0);
  103.         AISetLookThing(indy, lookTarg1);
  104.         AISetMoveThing(indy, walkTarg1, 0);
  105.         
  106.         # warrior looks towards indy
  107.         AISetLookThing(warrior, lw_lookTarg1);
  108.         
  109.         # play roar keyframe on warrior
  110.         PlaySoundThing(snd_Roar, warrior, 1.0, 15.0, 25.0, 0);
  111.         #AISetCutsceneMode(warrior);
  112.         PlayKey(warrior, warrior_Roar, 4, 0x12, 1);
  113.         #AIClearCutsceneMode(warrior);
  114.         
  115.         #AIWaitForStop(indy);
  116.         
  117.         # play startled animation
  118.         PlayKey(indy, indy_Startled, 4, 0x12, 0);
  119.         
  120.         # say voice line
  121.         voiceLine = PlayVoice(indy, say_RocksMove, 1.0, 0);
  122.         
  123.         Print("hi");
  124.         
  125.         # walk warrior closer to indy
  126.         AISetMoveSpeed(warrior, 0.6);   # 0.4
  127.         AISetMoveThing(warrior, lw_walkTarg1, 1);
  128.         
  129.         Print("hi2");
  130.         
  131.         WaitForSound(voiceLine);
  132.         
  133.         Print("hi3");
  134.         
  135.         Sleep(0.5);
  136.         
  137.         # Get the player into position
  138.         CopyOrientAndPos(indy, player);
  139.         
  140.         # stop any unfinished animations
  141.         ResetThing(player);
  142.         
  143.         # hide actor show player
  144.         SetThingFlags(indy, 0x80000);
  145.         ClearThingFlags(player, 0x80000);
  146.         
  147.         # return camera to player
  148.         SetCameraPosition(curcam, GetThingPos(cam_Meet));
  149.         SetCurrentCamera(curCam);
  150.         
  151.         # Return control to player
  152.         ClearActorFlags(player, 0x200000);
  153.         EndCutscene();
  154.         
  155.         # enable warrior ai
  156.         #AIClearCutsceneMode(warrior);
  157.     }
  158.     
  159.     return;
  160.  
  161. # ========================================================================================
  162.  
  163. end
  164.  
  165.